class HomeMo {
  HomeMo({
    required this.bannerList,
    required this.categoryList,
    required this.videoList,
  });
  late final List<BannerListMo> bannerList;
  late final List<CategoryListMo> categoryList;
  late final List<VideoListMo> videoList;

  HomeMo.fromJson(Map<String, dynamic> json) {
    bannerList = List.from(json['bannerList'])
        .map((e) => BannerListMo.fromJson(e))
        .toList();
    categoryList = List.from(json['categoryList'])
        .map((e) => CategoryListMo.fromJson(e))
        .toList();
    videoList = List.from(json['videoList'])
        .map((e) => VideoListMo.fromJson(e))
        .toList();
  }

  Map<String, dynamic> toJson() {
    final _data = <String, dynamic>{};
    _data['bannerList'] = bannerList.map((e) => e.toJson()).toList();
    _data['categoryList'] = categoryList.map((e) => e.toJson()).toList();
    _data['videoList'] = videoList.map((e) => e.toJson()).toList();
    return _data;
  }
}

class BannerListMo {
  BannerListMo({
    required this.id,
    required this.sticky,
    required this.type,
    required this.title,
    required this.subtitle,
    required this.url,
    required this.cover,
    required this.createTime,
  });
  late final String id;
  late final int sticky;
  late final String type;
  late final String title;
  late final String subtitle;
  late final String url;
  late final String cover;
  late final String createTime;

  BannerListMo.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    sticky = json['sticky'];
    type = json['type'];
    title = json['title'];
    subtitle = json['subtitle'];
    url = json['url'];
    cover = json['cover'];
    createTime = json['createTime'];
  }

  Map<String, dynamic> toJson() {
    final _data = <String, dynamic>{};
    _data['id'] = id;
    _data['sticky'] = sticky;
    _data['type'] = type;
    _data['title'] = title;
    _data['subtitle'] = subtitle;
    _data['url'] = url;
    _data['cover'] = cover;
    _data['createTime'] = createTime;
    return _data;
  }
}

class CategoryListMo {
  CategoryListMo({
    required this.name,
    required this.count,
  });
  late final String name;
  late final int count;

  CategoryListMo.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    count = json['count'];
  }

  Map<String, dynamic> toJson() {
    final _data = <String, dynamic>{};
    _data['name'] = name;
    _data['count'] = count;
    return _data;
  }
}

class VideoListMo {
  VideoListMo({
    this.id,
    this.vid,
    this.title,
    this.tname,
    this.url,
    this.cover,
    this.pubdate,
    this.desc,
    this.view,
    this.duration,
    this.owner,
    this.reply,
    this.favorite,
    this.like,
    this.coin,
    this.share,
    this.createTime,
    this.size,
  });
  late final String? id;
  late final int? vid;
  late final String? title;
  late final String? tname;
  late final String? url;
  late final String? cover;
  late final int? pubdate;
  late final String? desc;
  late final int? view;
  late final int? duration;
  late final Owner? owner;
  late final int? reply;
  late final int? favorite;
  late final int? like;
  late final int? coin;
  late final int? share;
  late final String? createTime;
  late final int? size;

  VideoListMo.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    vid = json['vid'];
    title = json['title'];
    tname = json['tname'];
    url = json['url'];
    cover = json['cover'];
    pubdate = json['pubdate'];
    desc = json['desc'];
    view = json['view'];
    duration = json['duration'];
    owner = Owner.fromJson(json['owner']);
    reply = json['reply'];
    favorite = json['favorite'];
    like = json['like'];
    coin = json['coin'];
    share = json['share'];
    createTime = json['createTime'];
    size = json['size'];
  }

  Map<String, dynamic> toJson() {
    final _data = <String, dynamic>{};
    _data['id'] = id;
    _data['vid'] = vid;
    _data['title'] = title;
    _data['tname'] = tname;
    _data['url'] = url;
    _data['cover'] = cover;
    _data['pubdate'] = pubdate;
    _data['desc'] = desc;
    _data['view'] = view;
    _data['duration'] = duration;
    _data['owner'] = owner?.toJson();
    _data['reply'] = reply;
    _data['favorite'] = favorite;
    _data['like'] = like;
    _data['coin'] = coin;
    _data['share'] = share;
    _data['createTime'] = createTime;
    _data['size'] = size;
    return _data;
  }
}

class Owner {
  Owner({
    required this.name,
    required this.face,
    required this.fans,
  });
  late final String name;
  late final String face;
  late final int fans;

  Owner.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    face = json['face'];
    fans = json['fans'];
  }

  Map<String, dynamic> toJson() {
    final _data = <String, dynamic>{};
    _data['name'] = name;
    _data['face'] = face;
    _data['fans'] = fans;
    return _data;
  }
}
